package com.example.menuvirtualclient.rule;

import java.util.List;

import android.content.Context;

import com.example.menuvirtualclient.core.*;
import com.example.menuvirtualclient.data.*;
import com.example.menuvirtualclient.repository.*;

public class SeccionRule {

	private ISession _session;
	private final MenuTypeRepository _repository;

	public SeccionRule(Context context) {
		_session = SessionFactory.GetSession(context);
		_repository = new MenuTypeRepository(context);
	}
	
	public List<MenuType> GetEntityList() throws Exception {
		try {
			_session.Open();
			return _repository.GetAll();
		} 
		catch (Exception ex) {
			throw ex;
		}
		finally{
			_session.Close();
		}
	}
	
}
